<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>个人社保计算软件-2117317228任续超</title>
		<!-- 新 Bootstrap 核心 CSS 文件 -->
		<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
		 
		<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
		<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
		 
		<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
		<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
		<script>
		//JS代码，作用是网页用户交互
		function calc(){
		//1.获取用户输入  2.开始计算   3.把计算结果放到单元格里
		//1.
		sal=document.getElementById("salary").value;
		salnum=parseInt(sal);
		//2.
		ylgr1=salnum*0.08;
		ylgs1=salnum*0.2;
		
		ybgr1=salnum*0.02;
		ybgs1=salnum*0.06;
		
		sygr1=salnum*0.005;
		sygs1=salnum*0.015;
		
		gsgs1=salnum*0.005;
		sybx1=salnum*0.008;
		
		gjjgr1=salnum*0.12;
		gjjgs1=salnum*0.12;
		
		grhj1=ylgr1+ybgr1+sygr1+gjjgr1;
		gshj1=ylgs1+ybgs1+sygs1+gsgs1+sybx1+gjjgs1;
		
		total=salnum+gshj1;
		//3.
		document.getElementById("total").innerText=total;
		
		document.getElementById("grhj").innerText=grhj1;
		document.getElementById("gshj").innerText=gshj1;
		
		
		document.getElementById("ylgr").innerText=ylgr1;
		document.getElementById("ylsg").innerText=ylgs1;
		
		document.getElementById("ybgr").innerText=ybgr1;
		document.getElementById("ybgs").innerText=ybgs1;
		
		document.getElementById("sygr").innerText=sygr1;
		document.getElementById("sygs").innerText=sygs1;
		
		document.getElementById("gsgs").innerText=gsgs1;
		document.getElementById("sybx").innerText=sybx1;
		
		document.getElementById("gjjgr").innerText=gjjgr1;
		document.getElementById("gjjgs").innerText=gjjgs1;
		}
		</script>
		</head>
	<body>
		<div class="container text-center">
		<h1 text-center>个人社保计算软件-Web版-2117317228任续超</h1>
		
			<table class="table table-bordered text-center>" 
				<tr>
					<td>工资</td>
					<td colspan="3">
					<input id="salary" class="form-control" type="text" placeholder="请输入工资"/>	
					</td>
					<td>
						<button onclick="calc()" class="btn btn-danger btn-block">计算</button>
					</td>
					<tr class="bg-primary">
						<td>险种</td>
						<td>个人%</td>
						<td>个人</td>
						<td>公司%</td>
						<td>公司</td>
					</tr>
					<tr>
						<td>养老</td>
						<td>8%</td>
						<td id="ylgr"></td>
						<td>20%</td>
						<td id="ylsg"></td>
					</tr>
					<tr>
						<td>医保</td>
						<td>2%</td>
						<td id="ybgr"></td>
						<td>6%</td>
						<td id="ybgs"></td>
					</tr>
					<tr>
						<td>失业</td>
						<td >0.5%</td>
						<td id="sygr"></td>
						<td>1.5%</td>
						<td id="sygs"></td>
					</tr>
					<tr>
						<td>工伤</td>
						<td></td>
						<td></td>
						<td>0.5%</td>
						<td id="gsgs"></td>
					</tr>
					<tr>
						<td>生育</td>
						<td></td>
						<td></td>
						<td>0.8%</td>
						<td id="sybx"></td>
					</tr>
					<tr>
						<td>公积金</td>
						<td>12%</td>
						<td id="gjjgr"></td>
						<td>12%</td>
						<td id="gjjgs"></td>
					</tr>
					<tr>
						<td>合计</td>
						<td>个人合计</td>
						<td id="grhj"></td>
						<td>公司合计</td>
						<td id="gshj"></td>
					</tr>
					<tr>
						<td>总额</td>
						<td colspan="4" id="total"></td>
					</tr>
				</tr>
			</table>
		</div>
	</body>
</html>
